Skip to content

Instantly share code, notes, and snippets.

View flameoftheforest's full-sized avatar
🤖
I believe! Help me with my unbelief!

Bryan Chong flameoftheforest

🤖
I believe! Help me with my unbelief!
  • Fujifilm
  • Sydney, NSW, Australia
View GitHub Profile
@keithmorris
keithmorris / remove-words.php
Created November 27, 2012 16:22
PHP remove common words from a string
<?php
function removeCommonWords($input){
// EEEEEEK Stop words
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni
@TooTallNate
TooTallNate / transcode.js
Last active April 6, 2024 14:03
Transcode an OGG Vorbis audio file to an MP3 using node-ogg, node-vorbis and node-lame
/**
* Module dependencies.
*/
var fs = require('fs');
var ogg = require('ogg');
var lame = require('lame');
var vorbis = require('vorbis');
@bosskovic
bosskovic / example.po
Last active March 14, 2022 09:43
A simple example of a PO file
msgid ""
msgstr ""
"Project-Id-Version: Lingohub 1.0.1\n"
"Report-Msgid-Bugs-To: [email protected] \n"
"Last-Translator: Marko Bošković <[email protected]>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@jamesinc
jamesinc / current-au-nsw-time.js
Created July 14, 2015 00:27
Calculate correct current AEST/ADST time
var getCurrentAestDate = function ( ) {
var d = new Date(),
timezone = 10,
utc = d.getTime() - ( d.getTimezoneOffset() * 60000 ),
// Current +10 (AEST) time
aest = new Date( utc + (3600000 * -timezone) ),
// Current +11 (ADST) time
adst = new Date( utc + (3600000 * -(timezone+1)) ),
// Set to start of the month DST starts (October)
// and time of rollover (0200)
@james2doyle
james2doyle / browser-body-class.php
Last active January 30, 2020 22:01
Add a custom body class to WordPress for the current browser being used. No external frameworks or plugins.
<?php
function custom_body_classes($classes)
{
// the list of WordPress global browser checks
// https://codex.wordpress.org/Global_Variables#Browser_Detection_Booleans
$browsers = ['is_iphone', 'is_chrome', 'is_safari', 'is_NS4', 'is_opera', 'is_macIE', 'is_winIE', 'is_gecko', 'is_lynx', 'is_IE', 'is_edge'];
// check the globals to see if the browser is in there and return a string with the match
$classes[] = join(' ', array_filter($browsers, function ($browser) {
@jamesstout
jamesstout / vagrant-vscode-php-xdebug-instructions.md
Last active August 5, 2021 19:29 — forked from sveggiani/instructions.md
Configure Xdebug, Visual Studio Code for a Vagrant VM

0. Assumptions

  • You've installed Xdebug in your VM.
  • You've installed Xdebug extension for VSCode and reloaded/restarted VSCode.
  • You have not forwarded port 9000 from the guest to the host.
  • Configure Debugger in VSCode. See item 1 next.

1. Configure .vscode/launch.json

@rupeshtiwari
rupeshtiwari / Setting up Webpack for Typescript Project From Scratch.md
Last active April 11, 2025 13:57
Setting up Webpack for Typescript Project From Scratch

Setting up Webpack for any Typescript project from Scratch

Welcome to step by step hands-on guide to setup webpack in your upcoming typescript project. Please follow the steps and you should be able to create your own webpack project. Please download the source code from github.

You will learn below things:

  1. ✅Create a Typescript node.js project.
  2. ✅Install Dependencies with webpack & typescripts.
  3. ✅Use Webpack CLI to crate webpack.config.js file and modify webpack.config.js based on our need.