Skip to content

Instantly share code, notes, and snippets.

@darekkay
darekkay / trakt-backup.php
Last active April 18, 2024 01:08
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@DvdFalaschi
DvdFalaschi / gist:b9e4445f7278cf80b8c70c4d3d635d05
Created April 18, 2024 01:04 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@bhaskarkc
bhaskarkc / noip-dyndns-update.py
Last active April 18, 2024 01:00
A python (python3) script to update no-ip (https://www.noip.com) dynamic dns ip.
#!/usr/bin/env python
import requests, socket
username = ""
password = ""
hostname = "" # your domain name hosted in no-ip.com
# Gets the current public IP of the host machine.
myip = requests.get('http://api.ipify.org').text
Just discovered this: an easy way to humanize the attributes of a model. Allows you to rename the database column name to something more reasonable. Makes for nicer, more understandable error messages back to the user.
class User < ActiveRecord::Base
HUMANIZED_ATTRIBUTES = {
:user_email => "E-mail address"
}
def self.human_attribute_name(attr)
HUMANIZED_ATTRIBUTES[attr.to_sym] || super
@rxaviers
rxaviers / gist:7360908
Last active April 18, 2024 01:04
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 18, 2024 00:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@esynr3z
esynr3z / run_tb.do
Last active April 18, 2024 00:54
Tcl script to run Modelsim simulation. Use "vsim -do run_tb.do" to start.
# Simply change the project settings in this section
# for each new project. There should be no need to
# modify the rest of the script.
set tb_name tb_top
set library_file_list [list \
work [list \
../../src/rtl/top.v \
../../src/tb/$tb_name.v] \
@n2o
n2o / nasm_m1.md
Last active April 18, 2024 00:53
Compiling x86_64 assembly program on M1 Mac

If you have an M1 Mac and want to compile and execute x86_64 assembly code, make sure you install Rosetta 2 and nasm (brew install nasm).

Than, take a 64 Bit assembly program, e.g. from this tutorial page (https://cs.lmu.edu/~ray/notes/nasmtutorial/) in Section "Your First Program" for macOS, save it to a file called hello.asm.

Compile, link and execute the program:

nasm -f macho64 hello.asm
ld hello.o -o hello -macosx_version_min 11.0 -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem

./hello

@SlyCodePanda
SlyCodePanda / rayCasting.py
Created January 15, 2020 05:27
Ray casting script in Maya using Python.
import maya.OpenMaya as om
import maya.cmds as cmds
def RayIntersect(mesh, point, direction):
# Clear selection.
cmds.select(cl=True)
# Select mesh.
om.MGlobal.selectByName(mesh)
@hopsoft
hopsoft / 00_do_stuff_job.rb
Last active April 18, 2024 00:50
ActiveJob as Service Worker
# ActiveJob natively captures constructor arguments in an `@arguments` instance variable
# which is also exposed as an `arguments` property on each job instance.
#
# Calls to `perform_now` and `perform_later` both forward arguments to the constructor.
#
# For example, all of these invocation styles work.
#
# result = DoStuffJob.new("foobar").perform # sync
# result = DoStuffJob.new.perform("foobar") # sync
# result = DoStuffJob.perform_now("foobar") # sync