Generator defined using the function*
statement syntax:
// function *idMaker(){ <- also possible, even though no reference found
function* idMaker(){
var index = 0;
while(index < index+1)
yield index++;
}
Generator defined using the function*
statement syntax:
// function *idMaker(){ <- also possible, even though no reference found
function* idMaker(){
var index = 0;
while(index < index+1)
yield index++;
}
Dumping games is the act of taking a game from your system or gamecart and copying it into a readable format onto your SD card. Dumping is perfectly legal if you keep the dumps to yourself, however sharing these dumps is piracy and is illegal.
This guide will tell you how to dump games from various formats and for various purposes. Dumping 3DS cartriges as .cia files is good if you want to install them to your system. Dumping them as .3ds files is good for emulators. Installed titles cannot be dumped as .3ds files. NDS cartiges can only be dumped as .nds files and cannot be installed (however, you can play them with emulators or flashcarts).
Dumping the RomFS of a game is primarily for romhacking purposess.
This is especially useful if you do not have an SD card reader or if you do not want to open the New 3DS' pesky shell.
There are two options: the official MicroSD management (New 3DS only) (Requires Windows) or FTPD (must have CFW or homebrew installed).
FTPD is quicker and easier to use in the long run and can be used on all systems and computers (and phones!); however, MicroSD management is official and can be done with a stock system.
#!/bin/bash | |
sudo curl -s -L gist.github.com/PixelSergey/58c86ae2d2fdea9d3327995d6e773b81/raw/setup.sh | sudo bash /dev/stdin arg1 arg2 | |
echo "Asterisk pyramid!" | |
declare -i n=20 | |
for (( i = 1; i <= n; i++ )); do | |
for (( k = i; k <= n; k++ )); do | |
echo -ne " " | |
done | |
for (( j = 1; j <= 2 * i - 1; j++ )); do |
A common use for Node.js is to build web applications. Usually, we want these applications to listen on port 80. As a security precaution, most OS’s require root privileges for this to happen (e.g. OS X, Linux, BSD). To run a Node application this way, we need to do the following:
sudo node server.js
Then, the application runs as root for the rest of the session. There are potential security risks to this, though. What if there is a vulnerability in your application and a hacker starts controlling your app and doing naughty things with it? Thankfully, we can drop the user account running our process to a less secured user, such as our normal account. There are two methods on the process global which can handle this for us, .setgid() and .setuid().
Here’s a working example of this in action. We want to run this code AFTER we bind to port 80, so we run the code in a callback:
Number.prototype.map = function (in_min, in_max, out_min, out_max) { | |
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
// MP Hooks © 2016 Mitchell Pell | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Windows.Forms; | |
namespace mp.hooks{ | |
// I had problems getting mouse movement events working in ncurses, but after | |
// some research, it seems as if this is how you can do it. The magic is in the | |
// printf("\033[?1003h\n") which was the missing piece in the puzzle for me | |
// (see console_codes(4) for more information). 1003 means here that all events | |
// (even position updates) will be reported. | |
// | |
// This seems to work in at least three X-based terminals that I've tested: | |
// xterm, urxvt and gnome-terminal. It doesn't work when testing in a "normal" | |
// terminal, with GPM enabled. Perhaps something for the next gist version? :) |
"""Heater | |
A program that spawns as much number of processes as there are CPUs on the computer. | |
This keeps the core temprature high. | |
I made this so that my fingers feel more comfortable while working on my laptop during winter. | |
Caution : An eye should be kept on the CPU temprature so that when it is getting too hot, | |
the prgoram needs to be killed; else it can damage the CPU. | |
Author : Ishan | |
Email : [email protected] | |
""" |