Skip to content

Instantly share code, notes, and snippets.

View ceaksan's full-sized avatar
🤹

Ceyhun Aksan ceaksan

🤹
View GitHub Profile
@drgarcia1986
drgarcia1986 / type.go
Last active December 22, 2017 20:10
Golang Error Handling examples
// By Type
// Go playground https://play.golang.org/p/lJOCJAq8WL
package main
import "fmt"
type ErrorX struct{}
func (e *ErrorX) Error() string {
return "It's error X"
@yigitbey
yigitbey / aynen.js
Last active February 12, 2018 18:41
Replaces Aynen to Evet.
// ==UserScript==
// @name Aynen Filter
// @namespace
// @description Replaces Aynen
// @include *
// @match *://*/*
// ==/UserScript==
document.body.addEventListener("DOMSubtreeModified", change, false);
change();
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@deltamobile
deltamobile / finalizer_example.go
Last active January 8, 2024 18:19
An example of the use of a finalizer (the runtime.SetFinalizer function) for a Go (golang) data structure. The documentation describes the expected signature for the function passed to SetFinalizer, but it is nice to see a running example. Tested with Go 1.1.2.
package main
import (
"fmt"
"runtime"
"time"
)
type Foo struct {
name string
@zoerooney
zoerooney / jquery-hash-filtering.js
Last active December 17, 2015 10:59
A few different ways to use URL information in WordPress themes, from a mini-tutorial here: http://zoerooney.com/blog/tutorials/using-the-referring-page-in-wordpress/
jQuery(document).ready(function($){
// Read URL and determine if it contains "free"
if(window.location.href.indexOf("free") > -1 ) {
// If it does, filter the list
$.filtrify("patterns-list", "filter", {
close : true, // let's not have any drop downs open
query : {
"cost" : ["free"] // pre-set the filter to only show free patterns
},
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@Aerilius
Aerilius / sips.sh
Created January 17, 2013 17:37
A shell script to translate Apple's SIPS (scriptable image processing system) commands to ImageMagick. It can be used to test software that depends on SIPS (and thus the proprietary Core Image) on any other unixoid system, ie. Linux.
#!/bin/bash
# This script translates some SIPS (scriptable image processing system) commands to ImageMagick.
# http://www.unix.com/man-page/all/1/sips
input=""
output=""
convertoption=""
while :
do
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
@stevenworthington
stevenworthington / ipak.R
Created July 25, 2012 19:44
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
###############################################################################
# Author: @BrockTibert
# Purpose: Collect Historical NHL Skater Stats 1960 - 2011 (in progress)
# Date: February 2011
#
# Used: R Version 2.12.1, Windows 7 Pro, StatET Plugin for Eclipse
#
# # Copyright (c) 2011, under the Simplified BSD License.
# For more information on FreeBSD see: http://www.opensource.org/licenses/bsd-license.php
# All rights reserved.