Skip to content

Instantly share code, notes, and snippets.

View LeetCodes's full-sized avatar
🎱
Choppin' caine rain, hail, sleet, or snow

LeetCodes

🎱
Choppin' caine rain, hail, sleet, or snow
View GitHub Profile
#==========================================================#
# Visualizing Facebook networks with friend photos #
# Katya Ognyanova, www.kateto.net, @ognyanova #
#==========================================================#
# Find more details at http://bit.ly/fbgephi
#==========================================================#
#### Collect the data using the RFacebook package ####
@LeetCodes
LeetCodes / rAF.js
Created February 19, 2018 16:39 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@LeetCodes
LeetCodes / l+kemoi.txt
Created February 22, 2018 09:35 — forked from dduleone/l+kemoi.txt
L&K Emoji
Raͩnͤsͣoͭmͪ
A
 aͣ bͣ cͣ dͣ eͣ fͣ gͣ hͣ iͣ jͣ kͣ lͣ mͣ nͣ oͣ pͣ qͣ rͣ sͣ tͣ uͣ vͣ wͣ xͣ yͣ zͣ
E
 aͤ bͤ cͤ dͤ eͤ fͤ gͤ hͤ iͤ jͤ kͤ lͤ mͤ nͤ oͤ pͤ qͤ rͤ sͤ tͤ uͤ vͤ wͤ xͤ yͤ zͤ
I
 aͥ bͥ cͥ dͥ eͥ fͥ gͥ hͥ iͥ jͥ kͥ lͥ mͥ nͥ oͥ pͥ qͥ rͥ sͥ tͥ uͥ vͥ wͥ xͥ yͥ zͥ
@LeetCodes
LeetCodes / TrueColour.md
Created February 26, 2018 11:15 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@LeetCodes
LeetCodes / ffmpeg.md
Created March 7, 2018 17:04 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@LeetCodes
LeetCodes / git-merges.md
Created March 8, 2018 12:26 — forked from dwurf/git-merges.md
A short article on git branching for new git users.

Branching with git for safe merging

Version Control is a critical tool in any software development project. Despite this, many of us suffer from a crippling fear of one terrifying event: The Dreaded Merge Conflict. Here I'll show you a risk-free way of merging with an easy way to back out if things go belly up.

The scenario

You've been working for hours on a bug fix. Your changes were due an hour ago and you've just finished your unit tests. It's time to upload your changes...

c:\dev>git status
# On branch master

Changes not staged for commit:

@LeetCodes
LeetCodes / gist:5e8d7ef42acb18e3383e32417285a9ac
Created March 28, 2018 09:50 — forked from ozh/gist:4131243
Create dot files/directories (ie .file) on Windows

#How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@LeetCodes
LeetCodes / QuickClip.vbs
Created April 5, 2018 01:56
Set, get, and clear ClipBoard text in VBScript.
Function QuickClip(input)
'@description: A quick way to set and get your clipboard.
'@author: Jeremy England (SimplyCoded)
If IsNull(input) Then
QuickClip = CreateObject("HTMLFile").parentWindow.clipboardData.getData("Text")
If IsNull(QuickClip) Then QuickClip = ""
Else
CreateObject("WScript.Shell").Run _
"mshta.exe javascript:eval(""document.parentWindow.clipboardData.setData('text','" _
& Replace(Replace(input, "'", "\\u0027"), """", "\\u0022") & "');window.close()"")", _

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

ImageMagick and FFMPEG commands

Remember that the order of parameters/options is very important.

convert images and save to another dir
convert *.png -set filename:original %t 'export/%[filename:original].jpg'
resize, change dpi and quality