Skip to content

Instantly share code, notes, and snippets.

View iraniamir's full-sized avatar
💪
Let's Dance

Amir Irani iraniamir

💪
Let's Dance
  • Internet
View GitHub Profile
@ebta
ebta / dat2mp4.bat
Created April 24, 2016 14:58
Fast convert VCD (*.dat) to MP4 with ffmpeg
"C:\Dir\ffmpeg\bin\ffmpeg" -i %1 -vcodec copy -acodec copy "F:\TargetDir\%~n1.mp4"
@sindbach
sindbach / mongodb_lookup.go
Created April 15, 2016 00:40
A simple example of how to use $lookup in Golang using mgo.
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
func main() {
session, err := mgo.Dial("localhost")
if err != nil {
@rtgibbons
rtgibbons / oc
Last active February 3, 2022 23:03
Openconnect init script
#! /bin/bash
### BEGIN INIT INFO
# Provides: openconnect
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Basic script to connect to a SSL VPN using Openconnect
### END INIT INFO
@awesomebytes
awesomebytes / Install_ubuntu14_dell_xps_13_9350_with_wifi_kernel_4.4.md
Created December 23, 2015 15:40
Install Ubuntu 14.04 on Dell XPS 13 9350 with Broadcom 4350 WIFI working with kernel 4.4-rc6

Install Ubuntu 14.04 on XPS 13 9350 with Broadcom 4350 card

Prepare BIOS

Go to the BIOS (press F12 on boot) > BIOS Setup

On General > Boot Sequence > Boot List Option
I have UEFI

On System Configuration > SATA Operation

<?php
/*
* Line break in WordPress meta box text area: the PHP way
*/
echo nl2br( esc_html( get_post_meta( get_the_ID(), 'my-meta-field', true) ) );
?>
@tahmidsadik
tahmidsadik / purgeAndroid.txt
Created September 19, 2015 18:47
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
package main
import (
"crypto/rand"
"log"
"math/big"
)
func sixDigits() int64 {
max := big.NewInt(999999)
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active April 9, 2025 09:08
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4