Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂

deejay87 deejay87

🙂
  • https://discord.gg/vykF8WqzVZ
  • France
View GitHub Profile
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active Dec 6, 2021
Portable Node.js and NPM on windows
View Portable Node.js andNPM on windows.md
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@morales2k
morales2k / posts_from_page.php
Last active Nov 18, 2020
Get Facebook public posts from a page. This requires facebook's php sdk, and a properly registered app.
View posts_from_page.php
<?php
function make_links($text, $class='', $target='_blank'){
return preg_replace('!((http\:\/\/|ftp\:\/\/|https\:\/\/)|www\.)([-a-zA-Zа-яА-Я0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?!ism', '<a class="'.$class.'" href="//$3" target="'.$target.'">$1$3</a>', $text);
}
define("APP_ID", 'xxxxxxxxxxxxxxxxxxx');
define("APP_SECRET",'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
define("PAGE_ID",'elnuevodia');
$config = array(
'appId' => APP_ID,