This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <regex.h> | |
printf("Enter the website URL:\n"); | |
fgets(str, 100, stdin); | |
if (!strcmp(str, "\n")) { |
This file contains hidden or 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
def snake_case | |
return downcase if match(/\A[A-Z]+\z/) | |
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). | |
gsub(/([a-z])([A-Z])/, '\1_\2'). | |
downcase | |
end | |
"FooBar".snake_case #=> "foo_bar" | |
"HeadlineCNNNews".snake_case #=> "headline_cnn_fake_news" | |
"CNN".snake_case #=> "cnn" |
This file contains hidden or 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
using System; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
// ReSharper disable InconsistentNaming | |
// ReSharper disable IdentifierTypo | |
namespace OpenGL | |
{ | |
[UnmanagedFunctionPointer(CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
This file contains hidden or 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
/* | |
* MIT License | |
* | |
* Copyright (c) 2020 Eric Freed | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
/* | |
* MIT License | |
* | |
* Copyright (c) 2020 Eric Freed | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
using System.Drawing; | |
using System.Collections.Generic; | |
using System.Linq; | |
using JetBrains.Annotations; | |
namespace MyNamespace | |
{ | |
/// <summary> | |
/// Represents a rectangular box shape. | |
/// </summary> |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'tty-prompt' | |
require 'fileutils' | |
@prompt = TTY::Prompt.new | |
def find_product(name) | |
paths = [] | |
Dir.entries(Dir.home).each do |entry| |
This file contains hidden or 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
/** | |
* @brief Applies a hue-shift in a GLSL fragment shader. | |
* | |
* @param color The color of the fragment to shift. | |
* @param hue The amount of hue-shift to apply, in radians. Use GLSL radians function to convert from degrees if needed. | |
* | |
* @return The hue-shifted fragment color. | |
*/ | |
vec3 hueShift(vec3 color, float hue) { | |
const vec3 k = vec3(0.57735, 0.57735, 0.57735); |
This file contains hidden or 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
#include <stdio.h> | |
#include <getopt.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
static struct option prime_opts[] = | |
{ | |
{"count", required_argument, NULL, 'c'}, |
This file contains hidden or 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
#!/usr/bin/env ruby | |
#============================================================================== | |
# | |
# Searches for a library either local or on the system and prints out a sorted | |
# list of all exported symbols found within it. (UNIX-like systems only) | |
# | |
# Useful for creating a wrapper/bindings for a C/C++ library. | |
# | |
# Example: exportsym tar |