Skip to content

Instantly share code, notes, and snippets.

View if1live's full-sized avatar
💭
I may be slow to respond.

byunghoo.yu if1live

💭
I may be slow to respond.
View GitHub Profile
@yagihiro
yagihiro / sample.c
Last active August 29, 2022 23:18
workqueue sample on linux kernel
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/workqueue.h>
static void mykmod_work_handler(struct work_struct *w);
static struct workqueue_struct *wq = 0;
static DECLARE_DELAYED_WORK(mykmod_work, mykmod_work_handler);
static unsigned long onesec;
@nebiros
nebiros / Gemfile
Created May 23, 2012 15:58
rails + unicorn + rbenv + init.d daemon
group :production do
gem "unicorn"
end
@emil10001
emil10001 / xfce_touchpad_settings
Created April 27, 2013 22:47
The accidental clicks while in crouton (chrooted Ubuntu) on my Pixel are kind of annoying. The touchpad is super sensitive, resulting in a lot of extra clicks on stuff when I'm typing. In XFCE, there's a pretty easy way to deal with this. Simply go to Settings -> Mouse -> Touchpad and un-check 'Tap touchpad to Click'. Optionally, also 'Disable t…
Settings -> Mouse -> Touchpad and un-check 'Tap touchpad to Click'
# Optionally, also
Settings -> Mouse -> Touchpad and check 'Disable touchpad while typing'
@mitsutaka
mitsutaka / aerofs.linux
Created July 7, 2013 07:33
Aerofs init script for linux
#! /bin/sh
USER=mitz
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Aerofs CLI Client"
NAME=aerofs
START_DAEMON="/usr/bin/aerofs-cli"
STOP_DAEMON="/usr/bin/aerofs-sh shutdown"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
@tsubaki
tsubaki / SkinnedMeshUpdater.cs
Created October 11, 2015 04:51
update SkinnedMesh
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Assertions;
using System;
public class SkinnedMeshUpdater : MonoBehaviour
{
[SerializeField]
SkinnedMeshRenderer original;
@mandarinx
mandarinx / optimizations.md
Last active September 28, 2023 03:51
Unity3D optimization tips

Unity3D optimization tips

Some code allocates memory when running in the editor and not on the device. This is due to Unity doing some extra error handling so possible error messages can be output in the console. Much of this code is stripped during build. It's therefore important to profile on device, and do it regularly.

Optimizations often makes code more rigid and harder to reason. Don't do it until you really need to.

When profiling, wrap methods or portions of a method in Profiler.BeginSample(string name) and Profiler.EndSample() to make them easier to find in the profiler.

public class SomeClass {
/**
* @author mrdoob / http://mrdoob.com/
*/
function html2canvas( element ) {
var range = document.createRange();
function getRect( rect ) {
@TarasOsiris
TarasOsiris / ShowToastUnityAndroid.cs
Created April 15, 2016 12:52
Shows toast on Android
public static void ShowToast(string text)
{
if (Application.platform == RuntimePlatform.Android)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call("runOnUiThread", new AndroidJavaRunnable(
()=>
{
@irokhes
irokhes / fake-date-sinon-node-js
Created June 4, 2016 13:22
Fake a date in node.js for testing with sinon
clock = sinon.useFakeTimers(new Date(2016,11,1).getTime());
new Date(); //=> return the fake Date 'Sat Nov 01 2016 00:00:00'
clock.restore();
new Date(); //=> will return the real time again (now)