Skip to content

Instantly share code, notes, and snippets.

View yat1ma30's full-sized avatar
🐕
On vacation

yat1ma30 yat1ma30

🐕
On vacation
View GitHub Profile
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* To use: copy this file to ~/Library/KeyBindings/
* after that any Cocoa applications you launch will inherit these bindings
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
@yat1ma30
yat1ma30 / transparent-gif.js
Last active August 29, 2015 14:26 — forked from sspencer/transparent-gif.js
Serve a transparent GIF from NodeJS
// Two ways to serve transparent GIF
var buf = new Buffer([
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00,
0x80, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02,
0x02, 0x44, 0x01, 0x00, 0x3b]);
res.send(buf, { 'Content-Type': 'image/gif' }, 200);
@yat1ma30
yat1ma30 / iptables.sh
Last active August 29, 2015 14:27 — forked from sandcastle/iptables.sh
Default firewall configuration using iptables for a fresh Ubuntu 14.04 server.
#!/bin/sh -x
# ==================================
# iptables default configuration script
#
# - this locks down our servers port access
# ==================================
# install fail2ban
sudo apt-get update
@yat1ma30
yat1ma30 / allauth_avatar.py
Created October 1, 2015 07:31 — forked from pennersr/allauth_avatar.py
Support for copying profile pictures into django-avatar was removed from django-allauth. This gist contains example code that you can drop into your own project in order to reinstate that functionality.
import urllib2
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from django.dispatch import receiver
from avatar.models import Avatar
from allauth.account.signals import user_signed_up
@yat1ma30
yat1ma30 / youtubeID.js
Created October 27, 2015 03:42 — forked from takien/youtubeID.js
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@yat1ma30
yat1ma30 / google_finance_intraday.py
Created June 24, 2017 22:31 — forked from lebedov/google_finance_intraday.py
Retrieve intraday stock data from Google Finance.
#!/usr/bin/env python
"""
Retrieve intraday stock data from Google Finance.
"""
import csv
import datetime
import re
import pandas as pd
@yat1ma30
yat1ma30 / 0_reuse_code.js
Created July 16, 2017 13:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yat1ma30
yat1ma30 / FollowGround.js
Created May 1, 2018 14:03 — forked from moyashipan/FollowGround.js
Unity3D: Function to following the ground
// You should change the center of this gameObject's mesh from default value (0,0,0).
// Because this script put its point to the contact point with the ground.
// And "use gravity" must be FALSE.
// Call HitTestWithRoad() from Update()
public var distance:float = 2.0;
public var smoothRatio:float = 0.2;
function HitTestWithRoad() {
@yat1ma30
yat1ma30 / GlowLevels.shader
Created March 17, 2022 23:23 — forked from jzayed/GlowLevels.shader
Glow Levels Shader
Shader "Sprites/GlowLevels"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_AlphaIntensity_Fade_1("_AlphaIntensity_Fade_1", Range(0, 3)) = 1
_TintRGBA_Color_1("_TintRGBA_Color_1", COLOR) = (1,1,1,1)
_AlphaIntensity_Fade_2("_AlphaIntensity_Fade_2", Range(0, 3)) = 1
_TintRGBA_Color_2("_TintRGBA_Color_2", COLOR) = (1,1,1,1)
@yat1ma30
yat1ma30 / SyncGameObjectWithEntity.cs
Created April 20, 2022 04:46 — forked from tsubaki/SyncGameObjectWithEntity.cs
GameObjectを破棄するとEntityも破棄される。もしくはその逆
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
/// <summary>
/// GameObjectを破棄する時、紐付いているEntityを破棄する。
/// </summary>
[RequireComponent(typeof(ConvertToEntity))]
[DisallowMultipleComponent]
[RequiresEntityConversion]