You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
György Kiss
kissgyorgy
Enthusiastic (as you can see above) Software Developer and System Engineer.
If you rename a field, then your users are fucked. Convert with a hardcoded array structure.
Most DB drivers [for PHP] will show integers as numeric strings and false as "0", so you want to typecast them.
Unless you're using an ORM with "hidden" functionality, people will see passwords, salts and all sorts of fancy codes. If you add one and forget to put it in your $hidden array then OOPS!
Use the URI sparingly, and correctly
Use the query string for paired params instead of /users/id/5/active/true. Your API does not need to be SEO optimised.
?format=xml is stupid, use an Accept: application/xml header. I added this to the CodeIgniter Rest Server once for lazy people, and now people think it's a thing. It's not.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
This is a very simple git workflow. It (and variants) is in use by many people.
I settled on it after using it very effectively at Athena.
GitHub does something similar; Zach Holman mentioned it
in this talk.
Update: Woah, thanks for all the attention. Didn't expect this simple rant
to get popular.
Best nginx configuration for improved security(and performance)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
How to Encode and Decode Strings with Base64 in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a usb disk with Elementary OS and Startup Disk Creator
# Boot it
sudo -i
apt-add-repository --yes ppa:zfs-native/stable
apt-get update
apt-get install --yes spl-dkms zfs-dkms ubuntu-zfs
stupidly simple way to integrate setup.py test with pytest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters